// components/ad-random/index.ts
Component({
  data: {
    randomAd: 1, // 默认广告类型
  },

  lifetimes: {
    attached() {
      this.setData({
        randomAd: Math.floor(Math.random() * 3) + 1 // 1~3 随机
      });
    }
  }
})